﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>目录</title>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" href="<%=basePath%>plug_in/images/icon/top.ico" type="image/x-icon"/>
    <base href="<%=basePath%>">
    <script src="<%=basePath%>/plug_in/js/jquery-1.11.1.min.js"></script>
    <!-- 引入layui -->
    <link rel="stylesheet" type="text/css" href="<%=basePath%>plug_in/layui254/css/layui.css">
    <script type="text/javascript" src="<%=basePath%>plug_in/layui254/layui.js"></script>

</head>


<body style="padding-left: 20px;padding-top: 20px;">

<!-- 功能区域 -->
<blockquote class="layui-elem-quote news_search">
    <form class="layui-form">
        <a class="layui-btn" onclick="addFirst()" style="margin-left:10px">建立菜单</a>
    </form>
</blockquote>

<div id="test1"></div>


</body>




<script>

    function addFirst() {
        layer.open({
            type:2,
            area: ['800', '500'],
            skin: 'layui-layer-lan',
            title: '新建目录' ,
            shade: [0.5, '#393D49'],
            btn: ['确定', '关闭'],
            maxmin: true, //开启最大化最小化按钮
            content:"<%=basePath%>/api/cata/jump",
            yes: function(index, layero){
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }

    function addOrUpdate(layEvent, tableName){
        layer.open({
            type:2,
            area: ['800', '500'],
            skin: 'layui-layer-lan',
            title: '日志详情' ,
            shade: [0.5, '#393D49'],
            btn: ['确定', '关闭'],
            maxmin: true, //开启最大化最小化按钮
            content:"<%=basePath%>/api/moni/detail?tableName="+tableName,
            yes: function(index, layero){
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });

    }

    var layer;
    layui.use('tree', function(){
        var tree = layui.tree;
        var thisLayer = layui.layer;
        //渲染
        var inst1 = tree.render({
            elem: '#test1'  //绑定元素
            ,data: [{
                title: '江西' //一级菜单
                ,children: [{
                    title: '南昌' //二级菜单
                    ,children: [{
                        title: '高新区' //三级菜单
                        //…… //以此类推，可无限层级
                    }]
                }]
            },{
                title: '陕西' //一级菜单
                ,children: [{
                    title: '西安' //二级菜单
                }]
            }]
        });
    });


</script>


</html>